package org.jeecg.common.modules.inquiry.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.common.modules.doctor.entity.Doctor;
import org.jeecg.common.modules.doctor.mapper.DoctorMapper;
import org.jeecg.common.modules.inquiry.entity.InquiryInfo;
import org.jeecg.common.modules.inquiry.mapper.InquiryInfoMapper;
import org.jeecg.common.modules.inquiry.service.IInquiryInfoService;
import org.jeecg.common.modules.inquiry.vo.InquiryReqVo;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: inquiry_info
 * @Author: jeecg-boot
 * @Date:   2020-08-31
 * @Version: V1.0
 */
@Service
public class InquiryInfoServiceImpl extends ServiceImpl<InquiryInfoMapper, InquiryInfo> implements IInquiryInfoService {
    @Resource
    private InquiryInfoMapper inquiryInfoMapper;

    @Override
    public int getInquiryNum(String patientId){
        LambdaQueryWrapper<InquiryInfo> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(InquiryInfo::getPatientId,patientId);
        return count(queryWrapper);
    }

    @Override
    public List<InquiryInfo> getInquiryList(String patientId){
        LambdaQueryWrapper<InquiryInfo> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.eq(InquiryInfo::getPatientId,patientId);
        return list(queryWrapper);
    }

    @Override
    public List<InquiryReqVo> getInquiryInfo(String id, String patientName, String userName, String doctorName,String type, Integer dataStart, Integer pageSize){
        return inquiryInfoMapper.selectInquiryInfo(id,patientName,userName,doctorName,type,dataStart,pageSize);
    }

    @Override
    public int getInquiryCount(String id, String patientName, String userName, String doctorName,String type){
        return inquiryInfoMapper.getInquiryCount(id,patientName,userName,doctorName,type);
    }
}
